import java.util.Scanner;

import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        HashMap<Character,Integer> map = new HashMap<>();
        StringBuffer sb = new StringBuffer();
        for(int i = 0;i < s.length();i++) {
            char ch = s.charAt(i);
            if(map.get(ch) != null) {
                if(i == map.get(ch) + 1) map.remove(ch);
                else map.put(ch,i);
            } else {
                map.put(ch,i);
            }
        }
        if(map.isEmpty()) System.out.println(0);
        else {
            for(int i = 0;i < s.length();i++) {
                if(map.get(s.charAt(i)) != null)
                    sb.append(s.charAt(i));
            }
        }
        String ret = sb.toString();
        for(int i = 0;i < ret.length();i++) System.out.print(ret.charAt(i));
        System.out.println();
    }
}